import cn.zut.edu.business.ScoreService;
import cn.zut.edu.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;


@ContextConfiguration("classpath*:database-context.xml")
public class mytest extends AbstractTestNGSpringContextTests {

    @Autowired
    Student student,student1;
    @Autowired
    ScoreService scoreService;

    @Test
    public void testQuerry(){
        System.out.println(scoreService.showAllStudent().toString());
    }
    @Test
    public void testAverageScore(){

    int n=scoreService.number();
    System.out.println("这"+n+"位学生的平均成绩为："+scoreService.averageScore());

    }

}
